import { createRouter, createWebHistory, createWebHashHistory } from "vue-router";

import MenuVue from "@/view/Menu.vue";
import AddWorkVue from "@/view/common/work/AddWork.vue";
import SelectWorkListVue from "@/view/common/work/SelectWorkList.vue";
import CourseVue from "@/view/common/course/Course.vue";
import CourseMangementVue from "@/view/common/course/CourseMangement.vue";
import CourseListVue from "@/view/common/course/CourseList.vue";
import CourseDetailVue from "@/view/common/course/CourseDetail.vue";
import AddSchoolVue from "@/view/system/school/AddSchool.vue";
import StudentProgressVue from "@/view/teacher/student/StudentProgress.vue";
import SelectWorkVue from "@/view/common/work/SelectWork.vue";
import UserInfoVue from "@/view/common/user/UserInfo.vue";
import UserSafe from "@/view/common/user/UserSafe.vue";
import LoginVue from "@/view/Login.vue";
import ClassAuthorizationVue from "@/view/common/course/ClassAuthorization.vue";
import AddSystemVue from "@/view/system/AddSystem.vue";
import CourseArticleVue from "@/view/common/course/CourseArticle.vue";
import HomeVue from "@/view/Home.vue";
import AddClassVue from "@/view/teacher/class/AddClass.vue";
import AddStudentVue from "@/view/common/course/Addstudent.vue";
import NowAddWorkVue from "@/view/common/work/NowAddWork.vue";
import testPaper from "@/view/common/testpaper.vue";
const routes = [
  { path: "/login", component: LoginVue },
  {
    path: "/", component: HomeVue
  },
  {
    path: "/menu",
    component: MenuVue,
    //重定向
    redirect: "/course/CourseList",
    //子路由
    children: [
      { path: "/work/NowAddWork", component: NowAddWorkVue },
      { path: "/work/SelectWorkList", component: SelectWorkListVue },
      { path: "/course/Course", component: CourseVue },
      { path: "/home", component: HomeVue, },
      { path: "/course/CourseMangement", component: CourseMangementVue },
      { path: "/course/CourseList", component: CourseListVue },
      { path: "/course/CourseDetail", component: CourseDetailVue },
      { path: "/school/AddSchool", component: AddSchoolVue },
      { path: "/student/StudentProgress", component: StudentProgressVue },
      { path: "/work/SelectWork", component: SelectWorkVue },
      { path: "/user/UserInfo", component: UserInfoVue },
      { path: "/user/UserSafe", component: UserSafe },
      {
        path: "/authorization/ClassAuthorization",
        component: ClassAuthorizationVue,
      },
      { path: "/system/AddSystem", component: AddSystemVue },
      { path: "/class/AddClass", component: AddClassVue },
      { path: "/course/AddStudent", component: AddStudentVue },
      { path: "/testpaper", component: testPaper },
    ],
  },
  { path: "/course/CourseArticle", component: CourseArticleVue },
];

//创建路由器
const router = createRouter({
  history: createWebHashHistory(),
  routes: routes,
});

export default router;
